<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>后台管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="../css/global.css?t=1488795362026" media="all">
<link rel="stylesheet" href="../css/layui.css?t=1488795362026"  >
<script src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../umeditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../umeditor/ueditor.all.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../umeditor/lang/zh-cn/zh-cn.js"></script>


</head>
<body>
<div class="layui-layout layui-layout-admin">
    

<div class="layui-header header header-demo">
    <div class="layui-main"> <a class="logo" href="/"> </a>
        <ul class="layui-nav" pc>
            <li class="right"> <span> 用户：jiadangwei</span><a href="/logout" class="out">退出</a> </li>
        </ul>
    </div>
</div>
    

<div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
        <ul class="layui-nav layui-nav-tree site-demo-nav">
            <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">内容管理</a>
                <dl class="layui-nav-child">
                    <dd class=""><a href="/channel/list">频道管理</a></dd>
                    <dd class=""><a href="/competition/list">赛事管理</a></dd>
                    <dd class=""><a href="/organization/list">机构管理</a></dd>
                    <dd class=""><a href="/feed/list">标准列表管理</a></dd>
                    <dd class=""><a href="/series/list">系列管理</a></dd>
                    <dd class=""><a href="/live/list">直播管理</a></dd>
                    <dd class=""><a href="/video/list">视频管理</a></dd>
                    <dd class=""><a href="/article/list">图文管理</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">创建内容</a>
                <dl class="layui-nav-child">
                    <dd class=""><a href="/demo/button.html">按钮组</a></dd>
                    <dd class=""><a href="/demo/form.html">表单集合</a></dd>
                    <dd class=""><a href="/demo/nav.html">导航与面包屑</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" style="height: 30px; text-align: center"></li>
        </ul>
    </div>
</div>

    <div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
        <div class="layui-body layui-tab-content site-demo site-demo-body">
            <div class="mian">
                <form class="layui-form enen">
                    <div class="layui-form-item">
                        <label class="layui-form-label">直播标题：</label>
                        <div class="layui-input-block">
                            <input type="hidden" name="id" value="24">
                            <input type="text" name="title" required  lay-verify="required" value="世纪对决，巴萨vs皇马" placeholder="请输入标题" autocomplete="off" class="layui-input" style="width:400px;">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">作者：</label>
                        <div class="layui-input-block">
                            <input type="text" name="author" value="小河马" placeholder="请输入作者" autocomplete="off" class="layui-input" style="width:400px;">

                            <input type="radio" name="belongType" value="6" title="机构">
                            <input type="radio" name="belongType" value="7" title="赛事">
                            <input type="radio" name="belongType" value="0" title="无" checked>

                            <input type="text" name="belongId" value="0"  placeholder="所属ID" autocomplete="off" class="layui-input" style="width:400px;">
                        </div>

                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">描述：</label>
                        <div class="layui-input-block">
                            <textarea name="description" required  lay-verify="required" placeholder="请输入内容" class="layui-textarea">巴萨对决皇马</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">默认封面图片：</label>
                        <div class="img btn_upload" >
                            
                                
                                    <img src="http://hippoapp.oss-cn-beijing.aliyuncs.com/hippoapp/admin/images/image/20170505/0f954e8729608a1566ffc71db9454440dce92c750054b3f48c40af7fcbf7ecae.png">
                                
                                
                            

                            <div class="layui-input-block" style="opacity:0" >
                                <input name="coverUrl" type="hidden" value="http://hippoapp.oss-cn-beijing.aliyuncs.com/hippoapp/admin/images/image/20170505/0f954e8729608a1566ffc71db9454440dce92c750054b3f48c40af7fcbf7ecae.png" class="_up_bg">
                                <input type="file" name="imgFile" lay-type="file" class="layui-upload-file" style="width:263px; height:165px; " >
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">关键字：</label>
                        <div class="keyword">
                            <select multiple name="tags" id="tags" style="width:400px" class="populate" >
                               <option>ddddd</option> 
                            </select>
                        </div>
                    </div>

                  





                   


                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    

<div class="layui-footer footer footer-demo">
    <div class="layui-main">
        <p>2017 &copy; <a href="/">layui.com</a> MIT license</p>
    </div>
</div>
<div class="site-tree-mobile layui-hide"> <i class="layui-icon">&#xe602;</i> </div>
<div class="site-mobile-shade"></div>
</div>
<script src="../layui.js"></script>
<script src="../js/fun.js"></script>
<script type="text/javascript" src="../js/lib/crypto1/crypto/crypto.js"></script>
<script type="text/javascript" src="../js/lib/crypto1/hmac/hmac.js"></script>
<script type="text/javascript" src="../js/lib/crypto1/sha1/sha1.js"></script>
<script type="text/javascript" src="../js/lib/base64.js"></script>
<script type="text/javascript" src="../js/lib/plupload-2.1.2/js/plupload.full.min.js"></script>
<script type="text/javascript" src="../js/upload.js"></script>

<script>
    $(".btn_upload").each(function(index, element) {
        var btn=$(this).find("img");
        var file=$(this).find(".layui-upload-file");
        btn.click(function(){
            file.click();
            window.self=$(this)
        })
        layui.use('upload', function(){
            layui.upload({
                url: '/upload/image.json'
                ,elem: file //指定原始元素，默认直接查找class="layui-upload-file"
                ,method: 'post' //上传接口的http类型
                ,success: function(res){
                    $(window.self).parents(".btn_upload").find("[type=hidden]").val(res.url)
                    $(window.self).parents(".btn_upload").find("img").attr("src",res.url)
                }
            });
        });
    });

    layui.use('form', function(){
        var form = layui.form();
        form.on('switch(switchTest)', function(data){
            layer.tips('开关checked：'+ (this.checked ? 'true' : 'false'), data.othis)
        });
        //监听提交
        form.on('submit(formDemo)', function(data){
            data.field.tags=$("#tags").val()
            //layer.msg(JSON.stringify(data.field));
            $.ajax({
                url: "/live/update.json",
                data:data.field,
                type: "POST",
                dataType: "json",
                success: function(data) {
                    if(data.rescode == 0) {
                        window.location.href = "/live/list";
                    } else {
                        layer.msg(data.resmsg);
                    }
                },
                error: function(er) {
                    BackErr(er);
                }
            });
            return false;
        });
    });
    var waitContent = UE.getEditor('waitArticle');
    var liveData = UE.getEditor('liveData');
    function uploadCallback(up, file, info){
        //将视频文件名字放到隐藏域
        $(".videoId").val(validate(get_uploaded_object_name(file.name)))
    }


  

</script>
</body>
</html>
